package test;

public class EnumTest2 {
	static Object o;
	public static void main(String[] args) {
		System.out.println(Enum.valueOf(A.class, "A2"));
	}
	
	public EnumTest2(){
		System.out.println(o);
	}
}

enum A {
	
	A1("a1"), A2("a2");
	static EnumTest2 test2;
	String s;
	public String toString() {
		return s;
	}
	
	private A(String s){
		this.s = s;
		System.out.println(s);//在static方法之前被调用
	}
	
	static{//枚举创建对象在static之前
		System.out.println("static");
	}
}